package com.xinziruo.crawl.application.crawl.impl;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import com.xinziruo.crawl.application.crawl.CrawlApiObjectService;
import com.xinziruo.crawl.domain.crawl.CrawlApiObject;
import com.xinziruo.crawl.domain.crawl.CrawlApiObjectRepository;
import com.xinziruo.crawl.infrastruture.util.Page;

/**
 * 
 * @author loudyn
 * @modify ajian
 * 
 */
@Transactional
public class CrawlApiObjectServiceImpl implements CrawlApiObjectService {
	private CrawlApiObjectRepository crawlApiObjectRepository;

	/**
	 * 
	 * @param crawlApiObjectRepository
	 */
	@Autowired
	public void setCrawlApiObjectRepository(CrawlApiObjectRepository crawlApiObjectRepository) {
		this.crawlApiObjectRepository = crawlApiObjectRepository;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.youboy.crawl.application.crawl.CrawlApiObjectService#delete(com.youboy
	 * .crawl.domain.crawl.CrawlApiObject)
	 */
	@Override
	public void delete(CrawlApiObject entity) {
		crawlApiObjectRepository.delete(entity);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.youboy.crawl.application.crawl.CrawlApiObjectService#store(com.youboy
	 * .crawl.domain.crawl.CrawlApiObject)
	 */
	@Override
	public void store(CrawlApiObject entity) {
		crawlApiObjectRepository.store(entity);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.youboy.crawl.application.crawl.CrawlApiObjectService#queryPage(com
	 * .youboy.crawl.infrastruture.persist.hibernate.query.Page,
	 * java.lang.String, java.util.Map)
	 */
	@Override
	public Page<CrawlApiObject> queryPage(Page<CrawlApiObject> page, String hql, Map<String, Object> values) {
		return crawlApiObjectRepository.queryPage(page, hql, values);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.youboy.crawl.application.crawl.CrawlApiObjectService#get(java.lang
	 * .String)
	 */
	@Override
	public CrawlApiObject get(String id) {
		return crawlApiObjectRepository.get(id);
	}

}
